home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: ncrgw2.ncr.com!ncrhub6!daynews!falcon!news
- From: Dick Menninger <Dick.Menninger@DaytonOH.ATTGIS.COM>
- Subject: Re: Exceptions vs. assertions
- X-Nntp-Posting-Host: 149.25.99.44
- Message-ID: <DKxspD.6Ev@falcon.daytonoh.attgis.com>
- Sender: news@falcon.daytonoh.attgis.com (News administrative Login)
- Reply-To: Dick.Menninger@DaytonOH.ATTGIS.COM (mennid)
- Organization: AT&T Global Information Solutions
- X-Newsreader: DiscussIT 2.5.1.3 for MS Windows [AT&T Software Products Division]
- References: <4crar1$9oh@dawn.mmm.com>
- Date: Tue, 9 Jan 1996 23:17:36 GMT
-
-
- > ==========Kevin J Hopps, 1/8/96==========
- >
- > Dick Menninger (Dick.Menninger@DaytonOH.ATTGIS.COM) wrote:
- >
- > > > ==========Kevin J Hopps, 1/2/96==========
-
- [Stuff deleted]
-
- > > I suspect there are problems to be modeled
- > > where they are best expressed with an exception used for
- > > the success path. In fact, that is one of the reasons I push
- > > for multiple simultaneous exceptions being valid in the language
- > > (so you can have an error exception while returning a success
- > > exception).
-
- > I'm not sure what you mean by "multiple simultaneous exceptions."
-
- I mean that the language should allow [and provide
- effective means to handle] more than one exceptional
- condition to exist at the same time.
-
- As it currently stands, if you are doing any form
- of high reliability system, once an exception has
- been thrown, you have to stand on your head to
- prevent a second from being thrown. You wind up
- having to catch early and often and never propogate
- it back as an exception. Instead, you are forced
- to use the old [but familiar] severe distortion of
- using return codes to propogate errors back up.
- This says to me that exceptions were a nice idea
- whose implementation in the language design
- failed to live up to expectations and goals.
-
-
- > > Such problems are likely to be related to problems
- > > where multi-level breaks (usually simulated by a goto) are very
- > > helpful in clarifying the expression of the model. For such
- > > problems, the solution may perform better with an exception
- > > for success.
-
- > Even if I thought that using a goto to simulate a multi-level break
- > was very helpful in clarifying the expression of the model, I would
- > probably avoid it if it both
- > a) was likely to occur with significant frequency, and
- > b) made the code 2-3 times slower.
-
- If it made the code slower, it is probably the wrong
- choice, though low frequency of use of the code
- could say that only clarity of expression matters.
- But the cases that I have seen improved both
- clarity and performance. It may have been true
- that a much more functionalized approach would
- have been as clear, but that was not on
- the radar screen because of severe performance
- penalties of such a solution to the particular
- problems in question. I am NOT advocating
- wide spread use of this. But if you tell me not
- to use it ever, I will simply ignore you when it
- winds up being the tool that hits the nail on the head.
-
- Good Day
- Dick
- Dick.Menninger@DaytonOH.ATTGIS.COM
-
-